package com.it.whitejotterapi.service.impl;

import com.it.whitejotterapi.dao.SysBookDao;
import com.it.whitejotterapi.service.SysBookService;
import com.it.whitejotterapi.tools.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 羡羡
 * @Date: 2022/05/23/18:08
 */
@Service
public class SysBookServiceImpl implements SysBookService {

    @Autowired
    SysBookDao sysbookdao;

    /**
     * 获取所有的图书
     * @return
     */
    @Override
    public JsonResult sysbookall() {
        List lis=sysbookdao.sysbookall();
        return new JsonResult(200,"获取成功！",lis);
    }

    /**
     * 图书分类
     * @param cid 图书类别ID
     * @return
     */
    @Override
    public JsonResult sysbookcate(int cid) {
        List lis=sysbookdao.sysbookcate(cid);
        return new JsonResult(200,"获取成功！",lis);
    }
}
